package org.timeticker.gui;

import org.timeticker.WorkTypeList;
import org.timeticker.WorkType;

import javax.swing.table.AbstractTableModel;

/**
 * Work types table model
 *
 * @author Ivan Latysh
 * @version 0.1
 * @since 10-Aug-2007 : 4:38:13 PM
 */
public class WorkTypesTableModel extends ObjectListTableModel<WorkType> {

  /**
   * Return work type list
   *
   * @return work type list
   */
  public WorkTypeList getWorkTypeList() {
    return (WorkTypeList) getObjects();
  }

  /**
   * Create a new table model for given work type list
   * @param workTypes work type list
   */
  public WorkTypesTableModel(WorkTypeList workTypes) {
    super(workTypes);
    // set up columns
    columns.add(new ObjectListTableModelColumn("Title", String.class, "title"));
    columns.add(new ObjectListTableModelColumn("Comments", String.class, "comments"));
  }

}
